Representing layered monads